package com.demo.io;

import java.io.File;
import java.io.IOException;

public class FileTest {
    public static void main(String[] args) {
        File f = new File("db.txt");
        System.out.println(f.exists());

        System.out.println("绝对路径:" + f.getAbsolutePath());
        if(!f.exists()){
            try {
                f.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
